package edu.qqcui.study.condition;

import edu.qqcui.study.bean.Blue;
import edu.qqcui.study.bean.Yellow;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 自定义的导入选择器类
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2021-06-26 14:28
 **/
public class MyImportSelector implements ImportSelector {

	/**
	 * Select and return the names of which class(es) should be imported based on
	 * the {@link AnnotationMetadata} of the importing @{@link Configuration} class.
	 *
	 * @param importingClassMetadata
	 * @return the class names, or an empty array if none
	 */
	@Override
	public String[] selectImports(AnnotationMetadata importingClassMetadata) {
		return new String[]{Blue.class.getName(), Yellow.class.getName()};
	}
}
